var windowWidth = document.documentElement.clientWidth;

var windowHeight = document.documentElement.clientHeight;

// 浏览器中心点横坐标
var centerX = windowWidth/2;

// 浏览器中心点纵坐标
var centerY = windowHeight/2;

$("#xc div").each(function(){

    // 随机生成横坐标
    var x = Math.random()*700-300;
    x = Math.floor(x);
    x = centerX + x - 50;

    // 随机生成纵坐标
    var y = Math.random()*700-450;
    y = Math.floor(y);
    y = centerY + y - 50;


    $(this).css("left",x+"px");
    $(this).css("top",y+"px");

    // 随机生成一个角度
    var angle = Math.random()*40;
    angle = angle>20?angle+20:angle;
    angle-=30;
    angle = Math.floor(angle)



    // 设置旋转
    $(this).css("transform","rotate("+angle+"deg)");

    
})





$("#xc div a").fancybox();
